package com.newcapec.modules.health.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.newcapec.common.utils.PageUtils;
import com.newcapec.common.utils.Query;
import com.newcapec.modules.health.dao.EducateDeptDao;
import com.newcapec.modules.health.entity.EducateDeptEntity;
import com.newcapec.modules.health.service.EducateDeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;


@Service("educateDeptService")
public class EducateDeptServiceImpl extends ServiceImpl<EducateDeptDao, EducateDeptEntity> implements EducateDeptService {

    @Autowired
    private EducateDeptDao educateDeptDao;

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<EducateDeptEntity> page = this.page(
                new Query<EducateDeptEntity>().getPage(params),
                new QueryWrapper<EducateDeptEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public List<EducateDeptEntity> find() {
        return educateDeptDao.select();
    }
}